package com.frame.common;

import javax.servlet.http.HttpSession;

public class ValidateNumber {

    static public final String NAME = "$V$validate-number$";

    static public boolean check(String number, HttpSession session)
    {
        String theNumber = (String) session.getAttribute(NAME);

        if (theNumber == null)
            return false;
        return theNumber.equals(number);
    }
    /**
     *
     * 功能:不分大小写验证<br>
     * 参数:<br>
     * 作者:王海锋<br>
     * 时间:2012-9-8 下午10:10:22<br>
     * 说明:<br>
     * 变更:<br>
     */
    static public boolean checkAll(String number, HttpSession session)
    {
        String theNumber = (String) session.getAttribute(NAME);
        if (theNumber == null)
            return false;
        theNumber=theNumber.toLowerCase();
        number=number.toLowerCase();
        return theNumber.equals(number);
    }
}
